from django.conf.urls import url
import Strategy.views.backtest_detail_views
# rbac对用户，角色，权限，菜单进行管理
from Strategy.views import strategy_views, backtest_detail_views, backtest_views

urlpatterns = [

    # 策略管理
    url(r'^$', strategy_views.strategy.as_view(), name='strategy_list'),
    # url(r'^new/$', strategy_views.strategy_new.as_view(), name='strategy_new'),
    # url(r'^edit/(?P<id>\d+)/$', strategy_views.strategy_edit.as_view(), name='strategy_edit'),
    # url(r'^delete/(?P<id>\d+)/$', strategy_views.strategy_delete.as_view(), name='strategy_delete'),

    # 回测管理
    url(r'^backtest$', backtest_views.backtest.as_view(), name='backtest'),
    # 回测详情

    # k线图
    url(r'^backtest/detail/candlestik$', backtest_detail_views.detail_candlestik.as_view(), name='detail_candlestik'),
    url(r'^backtest/detail/trade_table$', backtest_detail_views.detail_trade_list_table.as_view(),
        name='detail_trade_list_table'),
    url(r'^backtest/detail/position$', backtest_detail_views.position,
            name='position'),

    # 实盘指标数据
    # url(r'^backtest/detail/realtimeIndicators$', backtest_detail_views.detail_realTimeIndicators.as_view(), name='detail_realtimeIndicators'),
    # 实盘指标图
    url(r'^backtest/detail/cumulativereturns$', backtest_detail_views.detail_cumulativereturns.as_view(),
        name='detail_cumulativereturns'),

    url(r'^backtest/detail/monthlyreturns$', backtest_detail_views.detail_monthlyreturns.as_view(),
        name='detail_monthlyreturns'),
    url(r'^backtest/detail/annualreturns$', backtest_detail_views.detail_annualreturns.as_view(),
        name='detail_annualreturns'),
    url(r'^backtest/detail/monthDistribution$', backtest_detail_views.detail_monthDistribution.as_view(),
        name='detail_monthDistribution'),

    url(r'^backtest/detail/returnsBoxPlot$', backtest_detail_views.detail_returnsBoxPlot.as_view(),
        name='detail_returnsBoxPlot'),

    # 收益率统计
    url(r'^backtest/detail/incomeStatistics$', backtest_detail_views.detail_incomeStatistics.as_view(),
        name='detail_incomeStatistics'),

    # 模拟管理
    url(r'^sim$', backtest_views.sim, name='sim'),
    url(r'^symbols_btn$', backtest_detail_views.symbol_button, name='symbol_button'),
    # 新建策略url
    url(r'^get_strategy_id$', strategy_views.get_strategy_id, name='get_strategy_id'),
    url(r'^back_strategy_insert$', strategy_views.back_strategy_insert, name='back_strategy_insert'),
]
